Repository navigation
feat: pin func-utils image to a per-release-branch tag - #3994
Conversation
|
Skipping CI for Draft Pull Request. |
|
@matejvasek @lkingland WDYT? |
There was a problem hiding this comment.
🟡 Changes recommended
The current release-branch detection in the Makefile can fall back to v2 in detached-HEAD CI checkouts, undermining the intended per-branch pinning behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR makes func embed a more stable func-utils image tag per release branch/minor version to avoid older released CLIs being broken by changes published under a floating tag.
Changes:
- Derive
FUNC_UTILS_IMGfrom either an exact releaseKVERor arelease-X.Ybranch, otherwise defaulting tov2. - Align local e2e image publishing (
hack/images.sh) with the embedded image tag via a newmake func-utils-imagehelper. - Update docs and CI so
func-utilsimages are published asv2onmainandX.Yonrelease-X.Ybranches.
File summaries
| File | Description |
|---|---|
| Makefile | Derives and embeds a per-release-branch/per-minor func-utils image tag; adds func-utils-image helper target. |
| hack/images.sh | Publishes locally built func-utils images using the same tag embedded into the built func binary. |
| docs/README.md | Adds documentation link for the func-utils image policy. |
| docs/func-utils-image.md | Documents tag scheme and compatibility policy for func-utils. |
| .github/workflows/functions.yaml | Publishes func-utils as v2 on main and X.Y on release-X.Y, including manual dispatch support. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Automated Code Review
This PR pins the Findings1. Broad release-branch gate vs. strict tag regex — 2. Detached-HEAD fallback yields floating 3. 4. 5. Scope creep: deleted "Fork CI note" — 6. Redundant 7. Inaccurate KVER comment — Highest-value items: #1 (workflow fails red instead of skipping) and #2 (pin silently defeated in detached-HEAD builds). |
798b48b to
a1fc796
Compare
a1fc796 to
bc315d1
Compare
|
/retest |
|
/lgtm I haven't seen anything other than the things stated above. |
Every released CLI embeds ghcr.io/knative/func-utils:v2, which main re-publishes on every green push, so changes on main reach the cluster side of old CLIs. For example v1.20 runs "scaffold <path>", but v2 needs two arguments since knative#3237. Main now carries the image of the minor in development: it embeds func-utils:1.24, and its green pushes publish that tag. A release-X.Y branch cut from main already embeds func-utils:X.Y, and the image exists, so the cut needs no change and the release can go at once. - The reference lives in one constant, version.FuncUtilsImage. The three variables func reads default to it, so plain go build and source tarballs embed it too. FUNC_UTILS_IMG and -X ldflags still override it. make func-utils-image prints what a build embeds; the workflows, hack/images.sh and hack/release.sh read it from there. - The Functions workflow publishes the tag the source embeds, from main and from release branches. A release branch must embed its own minor. Once release-X.Y is cut, main skips the publish until it moves to the next minor, unless its commit is the branch head (the cut commit's own run), so main never overwrites X.Y. - Cutting release-X.Y runs the new workflow update-func-utils-image.yaml, which opens a PR that moves main to X.(Y+1). - hack/release.sh refuses a vX.Y.Z release unless the build embeds func-utils:X.Y and that image exists. - Nothing publishes v2 any more, so CLIs up to 1.23 keep the image as of this change. - docs/func-utils-image.md describes the tags, the compatibility rule and the release cut.
bc315d1 to
7249110
Compare
|
Ive fixed Matej's point 4, here's AI summary: 🤖 The design changed after these reviews. The PR description has the details. In short:
@matejvasek @lkingland could you take another look? Answers to @matejvasek's review:
|
|
/lgtm LGTM'ing this one as I believe it has matured enough, but keeping the hold to leave the merging to you/others. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aliok, gauron99, lkingland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |


Changes
Every released CLI embeds
ghcr.io/knative/func-utils:v2, and main re-publishesv2on every green push. So changes on main reach the cluster side of old CLIs: v1.20 runsscaffold <path>, butv2needs two arguments since #3237.Main now embeds the image of the minor in development,
func-utils:1.24, and its green pushes publish that tag. Arelease-X.Ybranch cut from main already embedsfunc-utils:X.Y, and the image exists, so the release can go out right after the cut.version.FuncUtilsImageinpkg/version/version.goholds the reference. The three variables func reads default to it, so plaingo buildand library users get it too.FUNC_UTILS_IMGand-Xldflags still override it.make func-utils-imageprints what a build embeds.functions.yamlpublishes the tag the source embeds, frommainand fromrelease-*. A release branch must embed its own minor. Oncerelease-X.Yexists,mainskips the publish (except for the cut commit) until it moves to the next minor, somainnever overwritesX.Y.update-func-utils-image.yaml: cuttingrelease-X.Yopens a PR that movesmaintoX.(Y+1). A maintainer has to start that PR's CI, because events made withgithub.tokenstart no workflows.hack/release.shrefuses avX.Y.Zrelease unless the build embedsfunc-utils:X.Yand that image exists.docs/func-utils-image.mddescribes the tags and the release cut.For reviewers
v2any more, so CLIs up to 1.23 keep the image as of this merge.mainmust publish:1.24, beforerelease-1.24is cut (knative 1.24 is due 2026-10-27).mainafter the merge should publishghcr.io/knative/func-utils:1.24./kind enhancement
Release Note
Docs
🤖 Generated with Claude Code